class Solution(object):
    def findKthLargest(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: int
        """
        k-=1
        
        def partition(begin, end):
            pivot = nums[begin]
            while begin<end:
                while begin<end and nums[end]<=pivot: end-=1
                nums[begin] = nums[end]
                while begin<end and nums[begin]>pivot: begin+=1
                nums[end] = nums[begin]
            nums[begin]=pivot
            return begin
        
        begin = 0
        end = len(nums)-1
        while begin<=end:
            mid = partition(begin, end)
            if k<mid: end = mid-1
            elif k>mid: begin = mid+1
            else: return nums[mid]
        return None
print(Solution().findKthLargest([1], 1))